Skip to main content

Making a VPN connection

The config files returned by the TPN endpoints are Wireguard config files that can be used by many devices to make VPN connections to the TPN miners.

Ways you can connect to these VPN tunnels include:

Command line usage

To use wireguard on the command line, make sure you have wireguard installed if it is ot installed by default (which is is on many deices). To check whether wireguard is installed on your device you can run which wg. To install:

  • Mac: brew install wireguard-tools
  • Linux (Debian/Ubuntu): sudo apt update && sudo apt install -y wireguard wireguard-tools

Command line example: system wide VPN

If you want to connect your whole system over the VPN, you could do the following:

#!/bin/bash

# Get a wireguard config file and write it to disk
curl -s "http://185.189.44.166:3000/api/config/new?format=text&geo=any&lease_minutes=5" > ./tpn_config.conf

# Log out your ip address before you connect
curl icanhazip.com

# Connect to the TPN server
wg-quick up ./tpn_config.conf

# Log out your ip address after connecting
curl icanhazip.com

# Disconnect the VPN connection
wg-quick down ./tpn_config.conf

Or if you use the json format:

#!/bin/bash

# Get a wireguard config file and write it to disk (assumes you have jq, which is a json parser)
curl -s "http://185.189.44.166:3000/api/config/new?geo=any&lease_minutes=5" | jq -r ".peer_config" > ./tpn_config.conf

# Log out your ip address before you connect
curl icanhazip.com

# Connect to the TPN server
wg-quick up ./tpn_config.conf

# Log out your ip address after connecting
curl icanhazip.com

# Disconnect the VPN connection
wg-quick down ./tpn_config.conf